// @Author miaoqing
// @Date 2024/02/27 16:28:00
// @Desc
package logic

import (
	"core/command"
	"core/component/logger"
)

// 家园服务器直接发送给客户端的数据包处理(home->online->gateway->client)
func (pc *PvpClient) pvpForwardPacketHandler(msgID uint16, data []byte) {
	msg := &command.PvpForwardPacket{}
	err := pc.tcpClient.Router.UnMarshal(data, msg)
	if err != nil {
		logger.Errorf("recv data:%v msg:%v", data, msg)
		return
	}
	player := world.getPlayer(msg.Playerid)
	if player != nil {
		player.sendForwardMsgToClient(msg.Data)
	}
}
